/*
 * Copyright (C) 2023 xuexiangjys(xuexiangjys@163.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.xuexiang.templateproject.http;

import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;

//import com.xuexiang.templateproject.core.BaseActivity;
//import com.xuexiang.templateproject.utils.NetworkUtil;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.reactivestreams.Publisher;
import org.reactivestreams.Subscription;
//import kotlin.jvm.internal.DefaultConstructorMarker;
import java.util.concurrent.TimeUnit;

import io.reactivex.Flowable;
import io.reactivex.Observable;
import io.reactivex.ObservableSource;
import io.reactivex.ObservableTransformer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
import kotlin.Metadata;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Lambda;
import kotlin.Unit;

public final class RxSchedulers {
    @NotNull
    public static final Companion Companion = new Companion();

    public static final class Companion {
        private Companion() {
        }


        /* JADX INFO: Access modifiers changed from: private */
        public static final void io_main$lambda$5$lambda$4(Function1 tmp0, Object obj) {
            Intrinsics.checkNotNullParameter(tmp0, "$tmp0");
            tmp0.invoke(obj);
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final ObservableSource request$lambda$1(Context context, Observable upstream) {
            Observable subscribeOn = upstream.subscribeOn(Schedulers.io());
//            final RxSchedulers$Companion$request$1$1 rxSchedulers$Companion$request$1$1 = RxSchedulers$Companion$request$1$1.INSTANCE;
            return subscribeOn
                    .doOnSubscribe(new Consumer() { // from class: d.m.a.b.d
                @Override // f.a.z.f
                public final void accept(Object obj) {
//                    RxSchedulers.Companion.request$lambda$1$lambda$0(Function1.this, obj);
                }
            })
//                    .compose(((BaseActivity) context).bindUntilEvent(ActivityEvent.DESTROY))
                    .observeOn(AndroidSchedulers.mainThread());
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final void request$lambda$1$lambda$0(Function1 tmp0, Object obj) {
//            Intrinsics.checkNotNullParameter(tmp0, "$tmp0");
            tmp0.invoke(obj);
        }


        @NotNull
        public final <T> ObservableTransformer<T, T> request(@NotNull final Context context) {
            return new ObservableTransformer() {
                @Override // f.a.q
                public final ObservableSource apply(Observable lVar) {
                    return  RxSchedulers.Companion.request$lambda$1(context, lVar);
                }
            };
        }


    }


}